home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2003 November / PCWK1103B.iso / DesignCAD 3D Max PLUS trial 30 / DATA1.CAB / Example_Files / Sample_Macros / Circles in Layers.d3m < prev    next >
Encoding:
Text File  |  2003-09-29  |  666 b   |  24 lines

  1. ' This BasicCAD macro cycles through the entire drawing, 
  2. ' and counts the # of circles on Layer 12
  3. '
  4.   b = 0
  5. ' Loop through every object in the drawing
  6. ' sys(9) is the number of entities in the drawing
  7.     for j = 1 to sys(9) 
  8. ' Get the Attributes of the current item
  9.     getattr j, type, select, laynum, group, red, green, blue
  10. ' if the Item is on Layer 12 then . . .
  11.     if laynum = 12 then 
  12.     ' If the item is a circle
  13.         if type = 16 then
  14.             b = b + 1
  15.         endif
  16.     endif
  17. ' Done with that object, loop back to select the next one
  18.     next
  19. ' Display Results
  20.     Message "# of Circles on Layer 12: ", b
  21. ' finished with every object in drawing, end program
  22.     end
  23.  
  24.